import 'package:flutter/material.dart';
import './stream_create_demo.dart';

class StreamListDemo extends StatelessWidget {
  const StreamListDemo({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('StreamListDemo'),
        elevation: 0.0,
      ),
      body: Container(
        child: ListView(
          children: <Widget>[
            itemBuilder('StreamDemo', StreamCreateDemo())
          ],
        ),
      ),
    );
  }
}

class itemBuilder extends StatelessWidget {
  const itemBuilder(this.title,this.page,{Key key}) : super(key: key);

  final String title;
  final Widget page;

  @override
  Widget build(BuildContext context) {
    return ListTile(
      title: Text(title),
      onTap: (){
        Navigator.of(context).push(
          MaterialPageRoute(builder: (context)=>page)
        );
      },
    );
  }
}